#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e6+7;
char a[maxn], b[maxn];
int alen, blen;
int kmp[maxn];
void kmp_precompute() {
  int j = kmp[0] = -1;
  int i = 0;
  while(i<blen) {
    while(j!=-1 && b[i] != b[j]) {
      j = kmp[j];
    }
    kmp[++i] = ++j;
  }
}
int kmp_match() {
  int cnt = 0;
  int j = 0;
  for(int i=0; i<alen; ++i) {
    while(j!=-1 && a[i]!=b[j]) {
      j=kmp[j];
    }
    j++;
    if(j>=blen) {
      cnt++;
    }
  }
  return cnt;
}
int main() {
  cin>>a>>b;
  alen=strlen(a);
  blen=strlen(b);
  kmp_precompute();
  cout<<kmp_match()<<'\n';
}
